class Beforework_trainFormModel extends Backbone.Model
    url: '/mytable/getModel?s=table.creators.Beforework_trainTable'
    initialize: (options) =>
        @fetch()
   
#--------------------------------------------------controler
class Beforework_trainsApp
    search: =>
        myapp.mainRegion.close() 
        mymodel = new Beforework_trainFormModel
        @layout = new ModelMainLayout(model: mymodel)
        myapp.mainRegion.show(@layout)

            

#--------------------------------------------------router
class Beforework_trainsAppRouter extends Backbone.Marionette.AppRouter
    appRoutes: 
        "beforework_trains": "search"

                
myapp.addInitializer -> 
    myapp.Beforework_trains_app = new Beforework_trainsApp()
    myapp.Beforework_trains_app.router = new Beforework_trainsAppRouter controller: myapp.Beforework_trains_app

myapp.vent.trigger("routing:started")
